package cn.virens.common.oauth.request.principal;

import cn.virens.common.util.exception.APIException;
import com.alibaba.fastjson2.annotation.JSONField;

import java.util.List;

@SuppressWarnings("serial")
public abstract class DelegatePrincipalResult extends DelegatePrincipalReadonly {
    private List<String> roleList;
    private List<String> permList;

    private String target;
    private String token;

    public void setRoleList(List<String> roleList) {
        this.roleList = roleList;
    }

    public void setPermList(List<String> permList) {
        this.permList = permList;
    }

    public void setLoginToken(String token) {
        this.token = token;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    /**
     * 获取登录令牌
     */
    public String getLoginToken() throws APIException {
        return token;
    }

    @Override
    @JSONField(serialize = false)
    public String getLoginAuth() throws APIException {
        return super.getLoginAuth();
    }

    /**
     * 获取角色列表
     */
    public List<String> getRoleList() {
        return roleList;
    }

    /**
     * 获取权限列表
     */
    public List<String> getPermList() {
        return permList;
    }

    /**
     * 获取登录来源地址
     */
    public String getTarget() {
        return target;
    }

}
